package validate

// Not that complicated!
func Nickname(nm string) string {
	res := Length(nm, 1, 30)
	if res == 1 {
		return "Too long. Try something with no more than 30 characters."
	}
	if res == -1 {
		return "Hey... I hope that was a mistake."
	}
	return ""
}

// Returns 1 if the string's length is above the specified range, -1 if lower or 0 if matches.
func Length(s string, min int, max int) int8 {
	len := len(s)
	if len < min {
		return -1
	}
	if len > max {
		return 1
	}
	return 0
}
